﻿using System;

namespace Borg
{
    [Serializable]
    public class LogEventArgs : EventArgs
    {
        private readonly string _message;
        private readonly MessageType _type;
        private readonly VerbosityLevel _verbosity;

        public string Message
        {
            get { return _message; }
        }

        public MessageType MessageType
        {
            get { return _type; }
        }

        public VerbosityLevel Verbosity
        {
            get { return _verbosity; }
        }

        public LogEventArgs(string message)
            : this(MessageType.Info, VerbosityLevel.Normal, message)
        { }

        public LogEventArgs(MessageType type, string message)
            : this(type, VerbosityLevel.Normal, message)
        { }

        public LogEventArgs(VerbosityLevel verbosity, string message)
            : this(MessageType.Info, verbosity, message)
        { }

        public LogEventArgs(MessageType type, VerbosityLevel verbosity, string message)
        {
            _type = type;
            _verbosity = verbosity;
            _message = message;
        }

        public LogEventArgs(MessageType type, VerbosityLevel verbosity, string message, params object[] val)
            : this(type, verbosity, string.Format(message, val))
        { }
    }

    public delegate void LogEventHandler(object sender, LogEventArgs args);
}

